package JAVATest;

import java.util.Scanner;

/**
 * ClassName:Text_015
 * Package:JAVATest
 * Description:
 *
 * @Author:ZhangXin
 * @Create2023/1/13-18:12
 * @Version:v1.0
 */
public class Text_015 {
    public static void main(String[] args) {
        int []arr =new int[4];
        Scanner sc = new Scanner(System.in);
        System.out.print("从键盘输入要加密的数字:");
        int number = sc.nextInt();
        int newNum=getNewArr(arr,number);
        System.out.println("加密后的密码是:"+newNum);
    }
    public static int getNum1(int number){
        int num1 = (((number%10)+5)%10);
        return num1;
    }
    public static int getNum2(int number){
        int num2=(((number/10)%10)+5)%10;
        return num2;
    }
    public static int getNum3(int number){
        int num3 = ((((number/100)%10)+5)%10);
        return num3;
    }
    public static int getNum4(int number){
        int num4 = ((number/1000)+5)%10;
        return num4;
    }
    public static int getNewArr(int[]arr,int number){
        int num = 0;
        int []newArr={getNum4(number),getNum3(number),getNum2(number),getNum1(number)};
        for (int i = newArr.length-1; i >=0; i--) {
            num = num * 10 +newArr[i];
        }
        return num;
    }



}
